home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 February / EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso / progs / thor / bbsread / reply2enter.br < prev    next >
Text File  |  1996-11-10  |  2KB  |  66 lines

  1. /* Reply2Enter.br
  2.  *
  3.  * Convert all active reply events on a bbs to enter events.
  4.  *
  5.  * Script by: Eivind Nordseth, Ultima Thule Software.
  6.  */
  7.  
  8. /*    trace results */
  9.  
  10.     EVE_ENTERMSG     =  0   /* Enter message */
  11.     EVE_REPLYMSG     =  1   /* Reply message */
  12.  
  13.     EDF_DELETED       = '00000001'x   /* Event is deleted */
  14.     EDF_DONE          = '00000004'x   /* Event is done */
  15.     EDF_ERROR         = '00000008'x   /* Error performing this event */
  16.     EDF_FREEZE        = '00000020'x   /* Event is frozen. Will not be done as long as this flag is set. */
  17.  
  18.     parse arg argument
  19.  
  20.     if(argument = '') then
  21.     do
  22.         say '$VER: Reply2Enter.br V3.1 (25.10.94)'
  23.         say 'Template: BBSNAME/A'
  24.         exit
  25.     end
  26.  
  27.     if ~show('p', 'BBSREAD') then do
  28.         address command
  29.             "run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead"
  30.             "WaitForPort BBSREAD"
  31.     end
  32.  
  33.     address BBSREAD
  34.  
  35.     GETBBSDATA argument stem BBSDATA
  36.     if(rc ~= 0) then 
  37.     do
  38.         say BBSREAD.LASTERROR
  39.         exit
  40.     end
  41.  
  42.     do n = BBSDATA.FIRSTEVENT to BBSDATA.LASTEVENT
  43.  
  44.         READBREVENT argument eventnr n datastem EVENTDATA tagsstem EVENTTAGS 
  45.         if(rc ~= 0) then 
  46.         do
  47.             say BBSREAD.LASTERROR
  48.             exit
  49.         end
  50.  
  51.         if EVENTDATA.EVENTTYPE == EVE_REPLYMSG then 
  52.         do
  53.             if bitand(EVENTDATA.FLAGS, bitor(bitor(bitor(EDF_DELETED, EDF_DONE), EDF_ERROR), EDF_FREEZE)) = '00000000'x then
  54.             do
  55.                 say 'Changing event nr:' n ' to an Enter event'
  56.  
  57.                 WRITEBREVENT argument event EVE_ENTERMSG stem EVENTTAGS updateeventnr n
  58.                 if(rc ~= 0) then 
  59.                 do
  60.                     say BBSREAD.LASTERROR
  61.                     exit
  62.                 end
  63.             end
  64.         end
  65.     end
  66.